import { useEffect, useMemo, useState } from 'react'

//抽象useTabs组件数据和方法
function useSum() {
    //获取数据
    const [num, setNum] = useState<number>(1)

    // console.log(1)

    useEffect(() => {
        setNum(num + 1)
    }, [])

    const sumAdd = useMemo(()=>{
        return num + 1
    },[num])

    return {
        num,
        setNum,
        sumAdd
    }
}

export { useSum }